#include "stdafx.h"
#include "com_catnapgames_winfolders_WinFoldersJava.h"

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    return TRUE;
}


JNIEXPORT jstring JNICALL Java_com_catnapgames_winfolders_WinFoldersJava_getSpecialFolderPath( JNIEnv *env, jclass, jint locationId ) 
{
	TCHAR pszPath[MAX_PATH];

/* locationId is a CSIDL_ constant. There's a couple of them predefined in
the Java file. You can add more, just look them up in shfolder.h */

	if ( SHGetSpecialFolderPath(NULL, pszPath, locationId, TRUE) ) {
		return env->NewStringUTF( pszPath );
	} else {
		return NULL;
	}
}
